import axios from './axios'

/**
 * 列表
 * @param {
 * current
 * name
 * size
 * status
 * }  
 * @returns 
 */
export const list = (data) => {
  return axios.post('system-role/page', data)
}

/**
 * 新增
 * @param {name,status,remark} data 
 * @returns 
 */

export const add = (data) => {
  return axios.post('system-role', data)
}

/**
 * 修改
 * @param {id,name,status,remark} data 
 * @returns 
 */

export const update = (data) => {
  return axios.put('system-role', data)
}

/**
 * 删除
 * @param {id} data 
 * @returns 
 */

export const del = (data) => {
  return axios.delete('system-role/' + data)
}

/**
 * 授权
 * @param {roleId,powers(array[string])} data 
 * @returns 
 */

export const power = (data) => {
  return axios.post('system-role/power', data)
}

/**
 * 获取有效角色ID和名称
 * @param {id} data 
 * @returns 
 */

export const select = (data) => {
  return axios.get('system-role/select', data)
}
export const get = (data) => {
  return axios.get('system-role/'+ data)
}